import { FC } from 'react';
import styles from './nav.less';
import { useSelector } from 'umi';
import useWeather from '../utils/useWeather';
import useTimer from '../utils/useTimer';

const Index: FC = () => {
  const title = useSelector((state: any) => state.admin.title);
  const [wtNm, wtTemp] = useWeather();
  const timer = useTimer();

  return (
    <nav className={styles.nav}>
      <div className={styles.title}>{title}</div>
      <div>
        {wtNm} - {wtTemp}℃ - {timer}
      </div>
    </nav>
  );
};

export default Index;
